<html>
<head><meta charset="utf-8"><title>elm error message catalog · t-compiler/wg-diagnostics · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/index.html">t-compiler/wg-diagnostics</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/elm.20error.20message.20catalog.html">elm error message catalog</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="178753368"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/elm%20error%20message%20catalog/near/178753368" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/elm.20error.20message.20catalog.html#178753368">(Oct 22 2019 at 13:06)</a>:</h4>
<p>Hey <span class="user-mention" data-user-id="119031">@Esteban Küber</span> and other <span class="user-group-mention" data-user-group-id="1187">@WG-diagnostics</span> folks:</p>
<p>Did you all see the <a href="https://elm-lang.org/news/the-syntax-cliff" target="_blank" title="https://elm-lang.org/news/the-syntax-cliff">new elm post</a> about syntax errors? Some cool stuff in there. One thing I particularly found interesting was this:</p>
<blockquote>
<p>So language designers never hear about this problem. I only understood its magnitude once elm/error-message-catalog got going. That repo solicits confusing error messages in hopes of finding ways to improve. I think projects like that legitimize the idea that "error messages should be better" such that I started hearing from a broader range of people. (Not just the very non-random sample of users that participate online!)</p>
</blockquote>
<p>I wonder if there are steps we can take to help encourage people to report confusing error messages. We already get enough, so maybe we don't need to do any new work here -- and I'm not sure if a dedicated repo is what we need -- maybe an issue template or something? Not sure. Anyway I thought it was cool!</p>
<p>(hat tip <span class="user-mention" data-user-id="203289">@boats</span>, who sent it to me)</p>



<a name="178753417"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/elm%20error%20message%20catalog/near/178753417" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/elm.20error.20message.20catalog.html#178753417">(Oct 22 2019 at 13:07)</a>:</h4>
<p>I feel like we've been doing these syntax oriented errors for a while now :)</p>



<a name="178753588"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/elm%20error%20message%20catalog/near/178753588" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/elm.20error.20message.20catalog.html#178753588">(Oct 22 2019 at 13:09)</a>:</h4>
<p>That's a awesome post. There's always room to do more, but I think we already (and by we, I mean <span class="user-mention" data-user-id="119031">@Esteban Küber</span> mostly) do a pretty good job at encouraging people to report confusing error messages and trying to improve them.</p>



<a name="178753944"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/elm%20error%20message%20catalog/near/178753944" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/elm.20error.20message.20catalog.html#178753944">(Oct 22 2019 at 13:13)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I read the post earlier; some points:</p>
<ol>
<li>We already get a lot of these reports; we track them with <code>D-newcomer</code>, <code>D-confusing</code>, etc.</li>
<li>We need to balance the happy path of the parser (the actual grammar of the language) with the amount of code required to do recovery and how invasive such recovery is. If an error message can be isolated into a dedicated method then fine, but I'm wary if it is not and requires tracking a lot of state.</li>
<li>We need to balance these long error messages which may be good for newcomers with inflating how quickly an error message can be read for intermediate and regular users. Longer diagnostics should be activated with <code>--teach</code></li>
<li>I think we already offer good, actionable, and often <code>MachineApplicable</code> suggestions. I'm not a fan of the anthropomorphization of the compiler, it doesn't make errors more actionable and just increases wordiness</li>
</ol>



<a name="178754021"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/elm%20error%20message%20catalog/near/178754021" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/elm.20error.20message.20catalog.html#178754021">(Oct 22 2019 at 13:14)</a>:</h4>
<blockquote>
<p>I feel like we've been doing these syntax oriented errors for a while now <span aria-label="slight smile" class="emoji emoji-1f642" role="img" title="slight smile">:slight_smile:</span></p>
</blockquote>
<p>Yes, the majority of the code in the parser is probably for such errors.</p>



<a name="178754377"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/elm%20error%20message%20catalog/near/178754377" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/elm.20error.20message.20catalog.html#178754377">(Oct 22 2019 at 13:18)</a>:</h4>
<blockquote>
<p>[...] I think projects like that legitimize the idea that "error messages should be better" [...]</p>
</blockquote>
<p>I think that's already an idea we back, but as aforementioned, diagnostics have a cost, and we should be cognizant of the bugs they introduce (ICEs, deviations from the actual grammar) and the difficulty of reading the code.</p>



<a name="178807639"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/elm%20error%20message%20catalog/near/178807639" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/elm.20error.20message.20catalog.html#178807639">(Oct 22 2019 at 23:11)</a>:</h4>
<p>1) regarding style, were a bit more terse and less friendly in the copy we choose to use, but we're friendlier than other compilers out there. I feel we strike a good middle point<br>
2) We should probably resuscitate --teach as a concept. I've spent a lot of time trying to add info to the existing default errors, but there's so much more we could mention with teach.<br>
3) There's a lot of code for diagnostics in the compiler already. We effectively support a superset of the language. But as we get increasingly more user friendly, it's getting harder to stay with no impact to the performance of the happy path.<br>
4) We do have a bias towards people with some level of experience writing code. Catering to absolute newcomers would probably be best served by the teach flag and possibly a more aggressive culling of errors.</p>



<a name="178813519"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/elm%20error%20message%20catalog/near/178813519" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/elm.20error.20message.20catalog.html#178813519">(Oct 23 2019 at 00:57)</a>:</h4>
<p>I prefer the terser error messages — the paragraph of text works when you just have one error, but not 10</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>